package cn.secondquestion;

public class JJX {

    public JJX() {
    }

    public void show(Graph graph){
        if (graph==null){
            System.out.println("错误!");
        }else if (graph instanceof Circle){
            Circle circle =(Circle) graph;
            circle.area();
            circle.perimeter();
        }else if (graph instanceof Rectangle){
            Rectangle rectangle = (Rectangle) graph;
            rectangle.area();
            rectangle.perimeter();
        }else if (graph instanceof Rhomboid){
            Rhomboid rhomboid = (Rhomboid) graph;
            rhomboid.area();;
            rhomboid.perimeter();
        }else if (graph instanceof  Trapezoid){
            Trapezoid trapezoid = (Trapezoid) graph;
            trapezoid.area();
            trapezoid.perimeter();
        }
    }
}
